Skip to content

Fix fork PR docs workflow (check PR comment from the fork)#2911

Closed
antonwolfy wants to merge 4 commits into
IntelPython:masterfrom
antonwolfy:fix-fork-pr-docs-workflow-fork
Closed

Fix fork PR docs workflow (check PR comment from the fork)#2911
antonwolfy wants to merge 4 commits into
IntelPython:masterfrom
antonwolfy:fix-fork-pr-docs-workflow-fork

Conversation

@antonwolfy
Copy link
Copy Markdown
Contributor

  • Have you provided a meaningful PR description?
  • Have you added a test, reproducer or referred to an issue with a reproducer?
  • Have you tested your changes locally for CPU and GPU devices?
  • Have you made sure that new changes do not introduce compiler warnings?
  • Have you checked performance impact of proposed changes?
  • Have you added documentation for your changes, if necessary?
  • Have you added your changes to the changelog?

antonwolfy and others added 4 commits May 11, 2026 11:51
The workflow incorrectly checked `base.repo.fork` (whether the target
repository is a fork) instead of `head.repo.fork` (whether the source
repository is a fork). This caused all PRs to IntelPython/dpnp to be
treated as upstream PRs, including fork PRs, which led to 403 errors
when trying to push to gh-pages.

Changes:
- Line 15: Changed base.repo.fork -> head.repo.fork in GH_EVENT_OPEN_PR_UPSTREAM
- Line 238: Changed base.repo.fork -> head.repo.fork in clean job condition

This bug was introduced in commit cb801da (PR IntelPython#2146, Nov 2024).

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Fork PRs cannot push to gh-pages due to restricted permissions, which
causes 403 errors. This commit adds logic to detect fork PRs and handle
them differently:

- Added "Check if fork PR" step to detect fork PRs
- Added "Upload docs artifact" step to save built docs as artifacts for fork PRs
- Modified "Publish pull-request docs" to skip fork PRs

Fork PRs will now pass the workflow by uploading artifacts instead of
attempting to publish to gh-pages.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Added unified comment step that posts different messages based on PR type:

- Fork PRs: Get detailed instructions for downloading and viewing docs
  artifact, including both gh CLI method and manual download steps
- Upstream PRs: Get direct URL to published docs on GitHub Pages

Both comment types use the same message-id so they update on subsequent
pushes to the PR.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
The GH_EVENT_OPEN_PR_UPSTREAM environment variable is no longer needed
since we now explicitly check fork status with steps.check_fork.outputs.is_fork.

Replaced with inline conditions that are more explicit and easier to read:
- github.event_name == 'pull_request'
- github.event.action != 'closed'
- steps.check_fork.outputs.is_fork == 'false'

Kept GH_EVENT_PUSH_UPSTREAM as it's still used for push-to-master deployments.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@antonwolfy antonwolfy self-assigned this May 11, 2026
@coveralls
Copy link
Copy Markdown
Collaborator

Coverage Status

coverage: 78.444%. remained the same — antonwolfy:fix-fork-pr-docs-workflow-fork into IntelPython:master

@antonwolfy
Copy link
Copy Markdown
Contributor Author

closing as no more relevant

@antonwolfy antonwolfy closed this May 11, 2026
@antonwolfy antonwolfy deleted the fix-fork-pr-docs-workflow-fork branch May 11, 2026 22:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants